@extends('layout/index')

@section('main')

<div class="mws-panel grid_8">

    <div class="mws-panel-header">
        <span>修改用户</span>
    </div>
    <div class="mws-panel-body no-padding">
        <form action="/Admin/user/update" method="post"   enctype="multipart/form-data" class="mws-form">
            <div class="mws-form-inline">
                <div class="mws-form-row bordered">
                    <label class="mws-form-label">用户名</label>
                    <div class="mws-form-item">
                        <input type="text" name="username" value="{{$res->username}}" class="small" readonly>
                    </div>
                </div>
                 <div class="mws-form-row bordered">
                    <label class="mws-form-label">昵称</label>
                    <div class="mws-form-item">
                        <input type="text" name="nickname" value="{{$res->nickname}}" class="small">
                    </div>
                </div>
                 <div class="mws-form-row bordered">
                    <label class="mws-form-label">头像</label>
                    <div class="mws-form-item">
                       @if($res->picname) 
                         <img id="img0" src="{{$res->picname}}" alt="" width="100" height="100" onclick='$("#file0").click()'>
                      @else
                        <img id="img0" src="/upload/1.jpg" alt="" width="100" height="100" onclick='$("#file0").click()'>
                     @endif
                          <div  style="display:none" >
                              <!-- <input type="file" name="picname" id="pic"> -->
                               <input type="file" name="picname" id="file0" multiple="multiple" />
                         </div>
                    </div>
                </div>
                 <div class="mws-form-row bordered">
                    <label class="mws-form-label">金币</label>
                    <div class="mws-form-item">
                        <input type="text" name="gold" value="{{$res->gold}}" class="small">
                    </div>
                </div>
                <div class="mws-form-row bordered">
                    <label class="mws-form-label">性别</label>
                    <div class="mws-form-item clearfix">
                        <ul class="mws-form-list inline">
                            <li><input type="radio" name="sex" 
                            @if($res->sex == 1)
                            checked = "checked"
                            @endif
                            value="1"> <label>男</label></li>
                            <li><input type="radio" name="sex"
                            @if($res->sex == 2)
                            checked = "checked"
                            @endif
                            value="2"> <label>女</label></li>
                        </ul>
                    </div>
                </div>
                 <div class="mws-form-row bordered">
                    <label class="mws-form-label">邮箱</label>
                    <div class="mws-form-item">
                        <input type="text" name="email" value="{{$res->email}}" class="small">
                    </div>
                </div>
                <div class="mws-form-row bordered">
                    <label class="mws-form-label">会员等级</label>
                    <div class="mws-form-item">

                        <select class="small" name="level">
                          @for($i=0;$i<4;$i++)
                          		@if("{{ $i }}"=="{{ $res->level }}")
                           		<option selected value="{{ $i }}">{{ getLevel($i)}}</option>
                         		@else
                         		<option value="{{ $i }}">{{ getLevel($i)}}</option>
                         		@endif
                           @endfor
                        </select>
                    </div>
                </div>

                <div class="mws-form-row bordered">
                    <label class="mws-form-label">状态</label>
                    <div class="mws-form-item clearfix">
                        <ul class="mws-form-list inline">
                            <li><input type="radio" name="status" 
                            @if("$res->status"== "1")
                            	 checked="checked"
                            @endif 
                            value="1"><label>正常状态</label></li>

                            <li><input type="radio" name="status"
                                @if("$res->status"== "0")
                                 checked="checked"
                                @endif 
                             value="0"> <label>禁用状态</label></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="mws-button-row">
            	{{ csrf_field() }}
            	<input type="hidden" name="id" value="{{ $res->id }}">
                <input type="submit" class="btn btn-danger" value="修改">
                <input type="reset" class="btn " value="重置">
            </div>
        </form>
    </div>      
</div>


@endsection